package com.ebupt.migu.music.scheduled;

import com.ebupt.migu.music.service.DataSyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @description: TODO
 * @author: liuyangyang@ebupt.com
 * @date: 2021/5/24 16:32
 */
@Slf4j
@Component
@EnableScheduling
public class DataSyncScheduled {

    @Autowired
    private DataSyncService dataSyncService;

    /**
     * SFTP数据同步
     */
    @Scheduled(initialDelay = 1000, fixedDelay = 1000 * 5)
    public void data_sync() throws Exception {
        dataSyncService.data_sync();
    }
}
